package org.gd.rest.jersey.server;

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
import com.google.inject.servlet.ServletModule;
import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;

public class Config extends GuiceServletContextListener {
    @Override
    protected Injector getInjector() {
        System.out.println("getInjector");
        return Guice.createInjector(new ServletModule() {
            @Override
            protected void configureServlets() {
                System.out.println("configureServlets");
                bind(Resource.class);
                bind(Counter.class);
                bind(JSONService.class);
                serve("*").with(GuiceContainer.class);
            }
        });
    }
}
